// instanceof没有办法判断基本值类型
let n = 123;
console.log("123 instanceof Number：",n instanceof Number); // false
console.log("'123' instanceof String：",'123' instanceof String); // false
console.log("boolean instanceof Boolean：",true instanceof Boolean); // false
console.log("Symbol('a') instanceof Symbol：",Symbol('a') instanceof Symbol); // false
console.log("123n instanceof Symbol：",123n instanceof BigInt); // false

// null和undefined无论怎么判断都是false
console.log("null instanceof Object：",null instanceof Object); // false
console.log("undefined instanceof Object：",undefined instanceof Object); // false

// function的情况:
let fun = function(){};
// 因为Function和Object都在函数的原型链上，所以都是true
console.log("fun instanceof Function：",fun instanceof Function); // true
console.log("fun instanceof Function：",fun instanceof Object); // true

// 数组的情况也和function相似
let arr = new Array();
console.log("arr instanceof Array",arr instanceof Array); // true
console.log("arr instanceof Object",arr instanceof Object); // true

// 字符串
let str = new String("123");
console.log("str instanceof String",str instanceof String); // true
console.log("str instanceof Object",str instanceof Object); // true

// 正则表达式
let reg = /^[a-zA-Z]{5,20}$/;
console.log("reg instanceof RegExp",reg instanceof RegExp); // true
console.log("reg instanceof Object",reg instanceof Object); // true
// new Number()和new Boolean()省略

let object = new Object();
console.log("object instanceof Object",object instanceof Object); // true
